package com.greensam.api.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Machengrui
 * @Date: 2024/9/24 20:41
 */
@Configuration
@EnableKnife4j
public class OpenApiConfig {

    @Bean
    public OpenAPI createOpenApi() {
        return new OpenAPI()
                .info(new Info()
                        .title("greensam贵山教育")
                        .description("greensam贵山教育接口文档")
                        .version("1.0")
                        .contact(new Contact()
                                .name("后端开发")
                                .url("www.greensam.com")
                                .email("ma1067034743@163.com")));


        /*return new Docket(DocumentationType.SWAGGER_2)
                .pathMapping("/")
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.greensam"))
                .paths(PathSelectors.any())
                .build().apiInfo(new ApiInfoBuilder()
                        .title("greensam贵山教育")
                        .description("greensam贵山教育接口文档")
                        .version("1.0")
                        .contact(new Contact("后端开发","www.greensam.com","ma1067034743@163.com"))
                        .build());*/
    }
}
